package site.lyun.service;

import org.springframework.transaction.annotation.Transactional;
import site.lyun.dao.GoodsDao;
import site.lyun.entity.Goods;
import site.lyun.entity.GoodsInf;
import site.lyun.entity.PageBean;
import site.lyun.entity.User;

import java.util.List;

@Transactional
public class GoodsService {
    private GoodsDao goodsDao;
    public GoodsDao getGoodsDao() {
        return goodsDao;
    }
    public void setGoodsDao(GoodsDao goodsDao) {
        this.goodsDao = goodsDao;
    }

    public boolean GoodsUpload(Goods goods){
        return goodsDao.GoodsUpload(goods);
    }

    public PageBean<Goods> GoodsFind(int page){
        return goodsDao.GoodsFind(page);
    }
    public Goods GoodsShow(int goodsId){
        return goodsDao.GoodsShow(goodsId);
    }

    public boolean GoodsBuy(Goods goods, User user){
        return goodsDao.GoodsBuy(goods,user);
    }

    public PageBean<GoodsInf> GoodsTradeInf(int page){
        return goodsDao.GoodsTradeInf(page);
    }
}
